package com.luzhikun.jsptest.myjsp;

import java.sql.Connection;
import java.sql.SQLException;
import java.util.Iterator;
import java.util.List;

/**
 * ClassName: Test
 * Description:
 * date: 2021/4/27 12:41
 *
 * @author luzhikun
 * @since JDK 1.8
 */
public class Test {

    public static void main(String[] args) {
        Connection connection = DBCPUtil.getConnection();
        if (connection != null) {
            try {
                System.out.println(connection);
                connection.close();
            } catch (SQLException throwables) {
                throwables.printStackTrace();
            }
        }

        StudentsIDao studentsIDao = new StudentsIDao();
        List<Students> students = studentsIDao.getStudent("吴");
        Iterator iterator = students.iterator();
        while (iterator.hasNext()) {
            Object next = iterator.next();
            System.out.println(next);

        }


    }


}
